# -*- coding: utf-8 -*-
# @Time    : 2022/1/17 12:31
# @Author  : mzp
# @Email   : 2609404548@qq.com
# @File    : page_Delete work.py
# @Software: PyCharm

from selenium.webdriver.common.by import By

from pages.page_base import PageBase


class DeleteWork(PageBase):
    work_agreement_locator=(111,749)#同意协议
    work_determine_locator = (342,817)  # 确定
    work_my_locator=(641,1242) #我的
    work_qq_locator=(469,1205)#点击QQ
    work_jurisdiction_locator=(356,1120) #进行授权
    work_xzwork_locator=(152,460) #点击作品
    work_jrwork_locator=(84,806) #进入页面
    work_fx_locator=(665,70) #分享
    work_scwork_locator=(By.ID," com.gfeng.daydaycook:id/riv_share")   #删除

    work_sc_locator=(By.XPATH,"//android.widget.TextView[@resource-id='com.gfeng.daydaycook:id/tv_title']") #确认删除

    def ele_agreement(self):
        """同意协议"""
        self.driver.tap([(self.work_agreement_locator)])

    def ele_determine(self):
        """确定按钮"""
        self.driver.tap([(self.work_determine_locator)])


    def ele_my(self):
        """我的"""
        self.driver.tap([(self.work_my_locator)])


    def ele_qq(self):
        """点击QQ"""
        self.driver.tap([(self.work_qq_locator)])

    def ele_jurisdiction(self):
        """进行授权"""
        self.driver.tap([(self.work_jurisdiction_locator)])

    def ele_xzwork(self):
        """点击作品"""
        self.driver.tap([(self.work_xzwork_locator)])

    def ele_jrwork(self):
        """作品页面"""
        self.driver.tap([self.work_jrwork_locator])

    def ele_fx(self):
        """分享"""
        self.driver.tap([(self.work_fx_locator)])

    def ele_scwork(self):
        """删除"""
        self.driver.find_element(*self.work_scwork_locator).click()

    def ele_sc(self):
        """确定删除"""
        self.driver.find_element(*self.work_sc_locator).click()
    def aggregate(self):
        self.ele_agreement()
        self.ele_determine()
        self.ele_my()
        self.ele_qq()
        self.ele_jurisdiction()
        self.ele_xzwork()
        self.ele_jrwork()
        self.ele_fx()
        self.ele_scwork()
        self.ele_sc()
